package com.inspectionwork.web.web;

import cn.hutool.json.JSONObject;
import com.inspectionwork.common.base.BaseController;
import com.inspectionwork.support.annotaion.Action;
import com.inspectionwork.support.annotaion.At;
import com.inspectionwork.support.model.RespEntity;
import com.inspectionwork.web.service.NoticeannouncementService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 通知公告控制器
 */
@Action
@RequestMapping(value="noticeAnnouncement")
public class NoticeannouncementController extends BaseController {
    @Resource
    public NoticeannouncementService noticeannouncementService;

    /**
     * 通知公告列表查询
     * @param
     * @return
     */
    @At(value = "listNoticeAnnouncementListPage", method = RequestMethod.GET)
    public RespEntity listNoticeAnnouncementListPage(@RequestBody(required = false) JSONObject jsonParam)  throws Exception{
        return noticeannouncementService.listNoticeAnnouncementListPage(jsonParam);
    }

    /**
     * 通知公告列表新增或修改
     * @param
     * @return
     */
    @At(value = "addOrUpdate", method = RequestMethod.POST)
    public RespEntity addOrUpdate(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return noticeannouncementService.addOrUpdate(jsonParam);
    }

    /**
     * 通知公告的删除
     * @param
     * @return
     */
    @At(value = "delete", method = RequestMethod.POST)
    public RespEntity delete(@RequestBody(required = false) JSONObject jsonParam) throws Exception {
        return noticeannouncementService.delete(jsonParam);
    }

    /**
     * 字典表查询
     * @param
     * @return
     */
    @At(value = "dictList", method = RequestMethod.GET)
    public RespEntity dictList(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeannouncementService.dictList(jsonParam);
    }

    /**
     * 通知公告详情
     * @param
     * @return
     */
    @At(value = "getById", method = RequestMethod.GET)
    public RespEntity getById(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeannouncementService.getById(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 通知公告下发删除
     * @Date Created in 14:05 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "deleteById", method = RequestMethod.POST)
    public RespEntity deleteById(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeannouncementService.deleteById(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description  工作管理信息统计
     * @Date Created in 14:05 2024/5/11
     * @Param [jsonParam]
     */

    @At(value = "workCount", method = RequestMethod.GET)
    public RespEntity workCount(@RequestBody(required = false) JSONObject jsonParam) {
        return noticeannouncementService.workCount(jsonParam);
    }

}
